<template>
  <div>
    <el-button type="primary"
               @click="add">添加</el-button>

    <el-select v-model="pageOpts.languageType"
               placeholder="请选择"
               @change="pageChange">
      <el-option v-for="item in lang"
                 :key="item.value"
                 :label="item.label"
                 :value="item.value">
      </el-option>
    </el-select>
  </div>
</template>
<script>
const lang = [
  {
    value: 0,
    label: "中文"
  },
  {
    value: 1,
    label: "英文"
  }
];
export default {
  data() {
    return {
      lang
    };
  },
  props: {
    pageOpts: Object
  },
  methods: {
    add() {
      this.$router.push({
        name: "addArticle"
      });
    },
    pageChange(languageType) {
      this.$emit("page-change", { ...this.pageOpts, languageType });
    }
  }
};
</script>

